<%
# Copyright (C) 2015 - present Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
%>

<% hide_self_reg_banner ||= false %>

<% if @domain_root_account && @domain_root_account.self_registration? && !hide_self_reg_banner %>
  <% if @domain_root_account.self_registration_type == 'observer' %>
    <% js_env :ACCOUNT => account_json(@domain_root_account, nil, session, ['registration_settings']),
              :PASSWORD_POLICY => @domain_root_account.password_policy %>
    <%= link_to '#',
          :id => 'coenrollment_link',
          :class =>  "ic-Login__link ic-Login__register-banner",
          data: reg_link_data(@domain_root_account.parent_auth_type)  do %>
      <div class="ic-Login__banner-title">
        {{#t}}Parent of a Canvas User?{{/t}}
      </div>
      <div class="ic-Login__banner-subtitle">
        {{#t}}Click Here For an Account{{/t}}
      </div>
    <% end %>
  <% else %>
    <%= link_to Setting.get("registration_link", "/register_from_website"),
                :id => 'register_link',
                :class => "ic-Login__link ic-Login__register-banner" do %>
      <div class="ic-Login__banner-title">
        {{#t}}Need a Canvas Account?{{/t}}
      </div>
      <div class="ic-Login__banner-subtitle">
        {{#t}}Click Here, It's Free!{{/t}}
      </div>
    <% end %>
  <% end %>
<% end %>

